widget: Draw focus outline
authorTimm Bäder <mail@baedert.org>
Wed, 3 May 2017 08:24:32 +0000 (10:24 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:10 +0000 (21:27 -0400)
gtk/gtkwidget.c

index 2e5203f7082d65988955bd1caac9a17d3ff1a475..39c5498d858ba6708f14070f5d15456ec52f944f 100644 (file)
@@ -15415,6 +15415,16 @@ gtk_widget_snapshot (GtkWidget   *widget,
         gtk_snapshot_pop (snapshot);
     }
 
+  if (gtk_widget_has_visible_focus (widget))
+    {
+      gtk_snapshot_offset (snapshot, margin.left, margin.top);
+      gtk_css_style_snapshot_outline (style,
+                                      snapshot,
+                                      allocation.width - margin.left - margin.right,
+                                      allocation.height - margin.top - margin.bottom);
+      gtk_snapshot_offset (snapshot, - margin.left, - margin.top);
+    }
+
   gtk_css_filter_value_pop_snapshot (filter_value, snapshot);
 
   if (GTK_DEBUG_CHECK (SNAPSHOT))